Create a bot#
First, you need to messaje @BotFather
here.
/newbot
Get User ID#
You can get the id of your account or group by sending the message /start
to the @GetIdsBot
here.
Configuration#
You can find the documentation here.
config/configuration.yaml
telegram_bot:
- platform: polling
api_key: "your bot key"
allowed_chat_ids:
- 44441111
notify:
- platform: telegram
name: "Fixt"
chat_id: 44441111
homeassistant:
allowlist_external_dirs:
- /tmp
Folder Watcher#
Automation Examples#
Part 1#
Trigger Video Recording
alias: Door notification
description: ""
trigger:
- entity_id: binary_sensor.entrance_door
from: 'off'
platform: state
to: 'on'
action:
- data:
message: Front Door Open
service: telegram_bot.send_message
- data:
duration: 15
entity_id: camera.entrance
filename: /tmp/entrance_{{ as_timestamp(now()) | int }}.mp4
service: camera.record
mode: single
Part 2#
Send video after recording is finished
alias: Send Recorded Entrance Video
description: ""
trigger:
- platform: event
event_type: folder_watcher
event_data:
event_type: closed
condition:
- condition: template
value_template: "{{ trigger.event.data.file.startswith('entrance_') }}"
action:
- service: notify.fixt
data_template:
message: ""
data:
video:
file: "{{ trigger.event.data.path }}"
caption: "{{\"\\U0001F3C3\"}} Entrance Video"
mode: single
I would love to hear your comments, or suggestions on this post.
Fixt is a Software Engineer passionate about making the world a better place through technology and automation.